package com.example.demo.controller;

import com.example.demo.entity.TUser;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

@RestController
@RequestMapping("/encode")
public class TestEncodeUrl {

    @RequestMapping("/cop")
    public void url(@RequestParam("url") String url) {
        System.out.println("url:"+url);

    }


        public static void main(String[] args) {
            try {
                String keyword = "你好 世界";
                keyword = "https://sz.qukanvideo.com/#/studioSubscribe/home";
                String encodedKeyword = URLEncoder.encode(keyword, "UTF-8");
                String url = "https://example.com/search?keyword=" + encodedKeyword;
                System.out.println(url);


                System.out.println("1111");
                System.out.println("2222");

                String aa = "User@rmrb";
                String yy = aa.replace("@rmrb","").toLowerCase();
                System.out.println("yy:"+yy);

            } catch (UnsupportedEncodingException e) {
                throw new RuntimeException(e);
            }
        }


}
